package com.serviceconsumer.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
@RestController
public class Testcontroller {

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("/test")
    public String test(){
        ResponseEntity<String> result = restTemplate.getForEntity("http://SPRINGCLOUD-EUREKA-CLIENT-PROVIDER/test",String.class);

        String body = result.getBody();

        return "eureka服务的消费者       ribbon" + body ;
    }
}
